<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');$set=setting_get('tt_redpacket');?>
<div class="row"><div class="col-lg-10 mx-auto"><div class="card"><div class="card-body" ><h3>后期技术支持</h3>官方网站：http://www.6rabbit.com/ <a href="http://www.6rabbit.com"target="_blank" style="text-decoration: none">点击进入</a><br>
官方QQ群：58911696（正常群）、77868272（只吹牛不讨论正事）</div></div><div class="card"><div class="card-body"><h3>设置可以发表红包的用户组</h3><form action="<?php echo url('plugin-setting-tt_redpacket');?>" method="post" id="form">
    <table class="table"><tr><th>用户组名</th><th>允许发表红包</th></tr>
    <?php foreach($grouplist as $_group){?><tr>
        <td> <?php echo $_group['name']; ?></td><td ><input type="checkbox" name="send_group[<?php echo $_group['gid'];?>]" <?php echo $_group['allowredpacket']=="1"?'checked':'';?>/></td></tr><?php }?>
    </table><hr><h3>细节设置</h3>
    <div class="form-group row"><label class="col-lg-9 form-control-label">允许一天后撤回红包(0不允许,1允许):</label><input class="col-sm-2 form-control" name="allow_cancel" value="<?php echo $set['allow_cancel'];?>"/></div>
    <div class="form-group row"><label class="col-lg-9 form-control-label">红包的货币种类(1经验,2金币,3人民币:分):</label><input class="col-sm-2 form-control" name="money_type" value="<?php echo $set['money_type'];?>"/></div>
    <button type="submit" class="btn btn-success btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
    </form></div></div></div></div>
<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>
<script>
    var jform = $("#form"); var jsubmit = $("#submit");
    jform.on('submit', function(){
        jform.reset(); jsubmit.button('loading');
        var postdata = jform.serialize();
        $.xpost(jform.attr('action'), postdata, function(code, message) {
            if(code == 0) {
                $.alert(message); setTimeout(function() {
                    window.location.reload();
                    jsubmit.button('reset'); }, 1000);
                return;
            } else {
                $.alert(message);
                jsubmit.button('reset'); }
        });
        return false;
    });
</script>